package org.csu.springjpetstore.persistence;

import org.csu.springjpetstore.domain.CartItem;
import org.csu.springjpetstore.domain.ShoppingCart;
import org.springframework.stereotype.Repository;

import java.math.BigDecimal;
import java.util.List;

@Repository
public interface ShoppingCartDAO {
    /**
     * description TODO
     *
     * @param username:
     * @param :
     * @return void
     * @author huangzhangyan
     * @date 2022/1/10 15:15
     */
    void store(String username, String itemid, int quantity, boolean instock, BigDecimal cartItemTotal);

    /**
     * description 获取用户的购物车的List<CartItem>
     *
     * @param username:
     * @return List<CartItem>
     * @author huangzhangyan
     * @date 2022/1/10 15:16
     */
    List<ShoppingCart> getCartList(String username);

    /**
     * description 删除用户的购物车
     *
     * @param username:
     * @return void
     * @author huangzhangyan
     * @date 2022/1/10 15:16
     */
    void deleteCart(String username, String itemId);

    void deleteCart1(String username);

    void deleteFullCart(String username);

    /**
     * description 获取用户购物车
     *
     * @param username:
     * @return List<CartItem>
     * @author huangzhangyan
     * @date 2022/1/10 15:17
     */
    List<CartItem> getCart(String username);

    void updateQuantityByUserName(String UserName, String ItemId, int Quantity);
}
